#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)

using namespace std;

using ll = long long;
using vec = vector < int >;
using pii = pair < ll, int >;
using tl = tuple < ll, ll, ll >;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 2010;
const ll inf = 1e18;

int n, m, t, l;
tl ed[N << 1];
vector < tl > p[N][N], G[N];
int x[100010];
ll dis[N << 1][N << 1];
int to[N];

void cut(vector < tl > &v) {
	vector < tl > res(5, tl(inf, inf, inf));
	for(const auto &x : v) if(get<0>(x) < get<0>(res[0])) res[0] = x;
	for(const auto &x : v) if(get<1>(x) != get<1>(res[0]) && get<0>(x) < get<0>(res[1])) res[1] = x;
	for(const auto &x : v) if(get<2>(x) != get<2>(res[0]) && get<0>(x) < get<0>(res[2])) res[2] = x;
	for(const auto &x : v) if(get<1>(x) != get<1>(res[0]) && get<2>(x) != get<2>(res[1]) && get<0>(x) < get<0>(res[3])) res[3] = x;
	for(const auto &x : v) if(get<2>(x) != get<2>(res[0]) && get<1>(x) != get<1>(res[2]) && get<0>(x) < get<0>(res[4])) res[4] = x;
	v.swap(res);
}

inline auto operator + (const vector < tl > &a, vector < tl > &b) {
	vector < tl > c;
	for(const auto &x : a) {
		for(const auto &y : b) {
			if(get<2>(x) != get<1>(y)) c.eb(get<0>(x) + get<0>(y), get<1>(x), get<2>(y));
		}
	} cut(c); return c;
}

namespace seg {
	const int N = 1e5 + 10;
	vector < tl > val[N << 1];
	int L[N << 1], R[N << 1], md[N << 1], rt, ndn, ch[N << 1][2];
	void build(int &o, int l, int r) {
		o = ++ndn; L[o] = l; R[o] = r; if(l == r) return val[o] = p[x[l]][x[l + 1]], void(); md[o] = (l + r) >> 1;
		build(ch[o][0], l, md[o]); build(ch[o][1], md[o] + 1, r); val[o] = val[ch[o][0]] + val[ch[o][1]];
	} 
	void upd(const int &pos, const int &o) {
		if(L[o] == R[o]) return val[o] = p[x[pos]][x[pos + 1]], void();
		if(pos <= md[o]) upd(pos, ch[o][0]); else upd(pos, ch[o][1]);
		val[o] = val[ch[o][0]] + val[ch[o][1]];
	}
	inline void init() { build(rt, 1, l - 1); }
	inline void upd(const int &pos) { upd(pos, rt); }
	inline ll qry() { return get<0>(val[rt][0]); }
}

void dijk(ll *dis, int id) {
	memset(to, -1, sizeof to);
	dis[id] = get<0>(ed[id]); priority_queue < pii, vector < pii >, greater < pii > > q; q.push({ dis[id], id });
	while(q.size()) {
		ll d = q.top().fi; int x = q.top().se; q.pop(); if(dis[x] < d) continue;
		int pos = get<2>(ed[x]);
		if(to[pos] == -1) {
			for(auto v : G[pos])
				if((get<2>(v) ^ 1) != x && dis[get<2>(v)] > d + get<0>(v)) {
					dis[get<2>(v)] = d + get<0>(v);
					q.push({ dis[get<2>(v)], get<2>(v) });
				}
			to[pos] = x;
		} else {
			if(dis[to[pos] ^ 1] > d + get<0>(ed[to[pos] ^ 1])) {
				dis[to[pos] ^ 1] = d + get<0>(ed[to[pos] ^ 1]);
				q.push({ dis[to[pos] ^ 1], to[pos] ^ 1 });
			}
		}
	}
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    n = in, m = in, t = in, l = in; int a, b, c; 
	rep(i, 0, m - 1) { a = in, b = in, c = in; ed[i << 1] = tl(c, a, b); ed[i << 1 | 1] = tl(c, b, a); G[a].eb(c, b, i << 1); G[b].eb(c, a, i << 1 | 1); }
	rep(i, 1, l) x[i] = in;
	memset(dis, 0x3f, sizeof dis); rep(i, 0, 2 * m - 1) dijk(dis[i], i);
	rep(i, 0, 2 * m - 1)
		rep(j, 0, 2 * m - 1) {
			int s, t, a, b; ll c1, c2;
			tie(c1, s, a) = ed[i]; tie(c2, b, t) = ed[j];
			//			cerr << i << " " << j << " " << s << " " << t << " " << dis[i][j] << endl;
			p[s][t].eb(dis[i][j], a, b);
		}
	rep(i, 1, n)
		rep(j, 1, n) cut(p[i][j]);//, cerr << "E" << i << " " << j << " " << get<0>(p[i][j][0]) << endl;
	seg :: init(); //cerr << seg :: qry() << endl;
	while(t--) {
		int p = in, q = in; x[p] = q;
		if(p > 1) seg :: upd(p - 1);
		if(p < l) seg :: upd(p);
		ll ans = seg :: qry();
		if(ans >= inf) ans = -1;
		printf("%lld\n", ans);
	} return 0;
}
